-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Support empty dict-likes in replace() #15294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some trivial changes. lgtm. ping on green.
pandas/tests/frame/test_replace.py
Outdated
@@ -1055,3 +1055,12 @@ def test_replace_datetimetz(self): | |||
Timestamp('20130103', tz='US/Eastern')], | |||
'B': [0, np.nan, 2]}) | |||
assert_frame_equal(result, expected) | |||
|
|||
def test_replace_with_empty_dictlike(self): | |||
mix = {'a': lrange(4), 'b': list('ab..'), 'c': ['a', 'b', nan, 'd']} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the issue number in a comment
pandas/tests/series/test_replace.py
Outdated
@@ -223,3 +223,8 @@ def test_replace2(self): | |||
self.assertTrue((ser[:5] == -1).all()) | |||
self.assertTrue((ser[6:10] == -1).all()) | |||
self.assertTrue((ser[20:30] == -1).all()) | |||
|
|||
def test_replace_with_empty_dictlike(self): | |||
s = pd.Series(list('abcd')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Codecov Report@@ Coverage Diff @@
## master #15294 +/- ##
=======================================
Coverage 86.33% 86.33%
=======================================
Files 139 139
Lines 51149 51149
=======================================
Hits 44157 44157
Misses 6992 6992
Continue to review full report at Codecov.
|
thanks @ExpHP nice PR! |
closes pandas-dev#15289 Author: Michael Lamparski <[email protected]> Closes pandas-dev#15294 from ExpHP/bugfix-15289 and squashes the following commits: f349e0a [Michael Lamparski] BUG: Support empty dict-likes in replace()
git diff upstream/master | flake8 --diff